package com.hornsun.data.constant.types;

/**
 * Created by 编译中... on 2018/8/18.
 */
public enum Terminal {
    WEB(1,"web端"),
    CLIENT_SIDE(2,"客户端");
    private Integer type;
    private String name;

    Terminal(Integer type , String name){this.type=type;this.name=name;}

    public Integer getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public static Terminal getByName(String name) {
        for (Terminal terminal : values()) {
            if (terminal.name.equals(name) ) {
                return terminal;
            }
        }
        return null;
    }
    public static Terminal getByType(Integer type) {
        for (Terminal terminal : values()) {
            if (terminal.type.equals(type)) {
                return terminal;
            }
        }
        return null;
    }
}
